package com.gma.userprofile.behavior.order

import com.gma.userprofile.util.{HBaseUtil, SparkUtil}

object UserProfileOrderMoney {
  def main(args: Array[String]): Unit = {

    //获取分区参数
    val ds = args.head

    //获取spark环境
    val spark = SparkUtil.getSparkSession

    //提取标签
    val tah = spark.sql(
      s"""
         |select
         |member_id as id,
         |sum(origin_price) as orderMoney
         |from
         |dwd.dwd_order_info_d_f
         |where ds='$ds'
         |group by member_id
         |
         |""".stripMargin)

    //保存到hbase
    HBaseUtil.tagToHBase(tah, "orderMoney")


  }

}
